angular.module('goods').controller('goodsListCtrl', function ($log, $scope, goodsService) {
    $scope.param = {
        number: 1,//当前页数
        size: 12,//每页条数
        maxSize: 4,//最大显示几页
        loadingFlag: false
    };

    $scope.goodsList = [];
    /**
     *     初始化
     */
    $scope.onInit = function () {
        $scope.param.loadingFlag = true;
        $scope.param.number = $scope.param.number - 1;
        goodsService.goodsList($scope.param).then(function (resp) {
            if (resp.status == 200) {
                $scope.param.number = resp.data.number + 1;
                $scope.param.totalElements = resp.data.totalElements;
                $scope.goodsList = resp.data.content;
                $scope.param.loadingFlag = false;
            }
        });
    }
    $scope.onInit();
});